<?php
/**
 * 路由设置
 * User: yangyang
 * Date: 2016/7/22
 * Time: 19:46
 */

//路由对象
$router = new \Phalcon\Mvc\Router();

/**
 * 自动删除结尾额外的斜杆
 */
$router->removeExtraSlashes(true);

/**
 * 设置默认路径
 */
$router->setDefaultModule("v1");
$router->setDefaultController("home");
$router->setDefaultAction("index");

$router->add('/:module', array(
	'module' => 1,
	'controller' => 'home',
	'action' => 'index',
));

$router->add('/:module/:controller', array(
	'module' => 1,
	'controller' => 2,
	'action' => 'index',
));

$router->add('/:module/:controller/:action', array(
	'module' => 1,
	'controller' => 2,
	'action' => 3,
));


return $router;
